
<?php 
	include "../ini.php";
	include "../../libraries/xl_san_pham.php";
	include "../../libraries/pager.php";
	$dt_pager = new pager;
	$dt_xl_san_pham	= new xl_san_pham;
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include"../includes/js_css.php"?>
</head>
<body>
<div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
  
  <?php include"../widgets/sidebar.php"?>
  <!-- End #sidebar -->
  
  <div id="main-content"> <!-- Main Content Section with everything -->
    
    <?php include"../widgets/noscript.php"?>
    <div class="clear"></div>
    <!-- End .clear -->
    
    <div class="content-box"><!-- Start Content Box -->
      
      <div class="content-box-header">
        <h3>Danh sách sản phẩm</h3>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      <form action="deletes.php" method="post" name="f2">
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
          <?php message()?>
          <table>
            <thead>
              <tr>
                <th>Mã</th>
                <th>Tên sản phẩm</th>
                <th><div style="text-align:center;">Đơn giá</div></th>
                <th><div style="text-align:center;">Hình ảnh</div></th>
                <th><div style="text-align:center;">Trạng thái</div></th>
                <th><div style="text-align:center;">Sản phẩm mới</div></th>
                <th style="text-align:center !important;"><input class="check-all" type="checkbox" id="check_all" ><a href="#"onclick="if(confirm('Bạn có chắc muốn xóa sữa hay không')==true)document.f2.submit()"> <img src="../images/cross.png" border="0" align="absmiddle" /> Xóa</a>
                </th>
              </tr>
            </thead>
            <tfoot>
              <tr>
                <td colspan="6"><input class="button" type="submit" value="Xóa" >
                  <input class="button" type="button" value="Thêm" >
                  <div class="pagination">
                  <?php 
				  $tong_so_dong = $dt_xl_san_pham->so_luong();
				  $tong_so_trang = $dt_pager->findPages($tong_so_dong,BAIVIET_LIMIT);
                  echo $dt_pager->pageList($_GET['page'],$tong_so_trang);
				  ?>
                  </div></td>
              </tr>
            </tfoot>
            <tbody>
            	 <?php 
					$vitri = $dt_pager->findStart(BAIVIET_LIMIT);
					$ds_san_pham = $dt_xl_san_pham->danh_sach($vitri,BAIVIET_LIMIT);
					foreach($ds_san_pham as $san_pham){
				?>
             	<tr class="alt-row">
                <td><?php echo $san_pham['ma']; ?></td>
                <td class="tensp"><a  href="edit.php?id=<?php echo $san_pham['ma']?>"><?php echo $san_pham['ten']; ?></a></td>
                <td style="text-align:center"><strong><?php echo $san_pham['don_gia']; ?></strong>&nbsp;VNĐ</td>
                <td  style="text-align:center"><img  src="../../uploads/san_pham/<?php echo $san_pham['hinh'] ?>" width="50px" height="50px"/></td>
                <td style="text-align:center"><a href="#"> <?php echo $san_pham['trang_thai']; ?> </a></td>
                <td style="text-align:center !important"><a href="#"> <?php echo $san_pham['san_pham_moi']; ?> </a></td>
                <td style="text-align:center !important"><a title="Edit" href="edit.php?id=<?php echo $san_pham['ma'] ?>"> <img alt="Edit" src="../skins/sa/resources/images/icons/pencil.png"> </a> <a title="Delete" href=" delete.php?id=<?php echo $san_pham['ma']?>"> <img alt="Delete" src="../skins/sa/resources/images/icons/cross.png"> </a>
                
                  <input type="checkbox" value="222" name="item[]" onclick="chon_item(this.checked)"></td>
              </tr>
              <?php }?>            
            </tbody>
          </table>
        </div>
        <!-- End #tab1 --> 
        
      </div>
      </form>
      <!-- End .content-box-content --> 
      
    </div>
    <!-- End .content-box -->
    
    <div class="clear"></div>
    <?php include"../widgets/footer.php"?>
  </div>
  <!-- End #main-content --> 
  
</div>
</body>
</html>
